package shangpinrizhi

import "github.com/shopspring/decimal"

type Model struct {
	ID          int64           `json:"id" gorm:"column:id;primaryKey;autoIncrement;comment:自增ID"`
	Type        string          `json:"type" gorm:"column:type;type:enum('visit','cart','order','pay','collect','refund');not null;comment:类型"`
	ProductID   int             `json:"product_id" gorm:"column:product_id;not null;default:0;comment:商品ID"`
	Uid         int             `json:"uid" gorm:"column:uid;not null;default:0;comment:用户ID"`
	VisitNum    int8            `json:"visit_num" gorm:"column:visit_num;type:tinyint(1);not null;default:0;comment:是否浏览"`
	CartNum     int             `json:"cart_num" gorm:"column:cart_num;not null;default:0;comment:加入购物车数量"`
	OrderNum    int             `json:"order_num" gorm:"column:order_num;not null;default:0;comment:下单数量"`
	PayNum      int             `json:"pay_num" gorm:"column:pay_num;not null;default:0;comment:支付数量"`
	PayPrice    decimal.Decimal `json:"pay_price" gorm:"column:pay_price;type:decimal(12,2);not null;default:0.00;comment:支付金额"`
	CostPrice   decimal.Decimal `json:"cost_price" gorm:"column:cost_price;type:decimal(12,2);not null;default:0.00;comment:商品成本价"`
	PayUid      int             `json:"pay_uid" gorm:"column:pay_uid;not null;default:0;comment:支付用户ID"`
	RefundNum   int             `json:"refund_num" gorm:"column:refund_num;not null;default:0;comment:退款数量"`
	RefundPrice decimal.Decimal `json:"refund_price" gorm:"column:refund_price;type:decimal(12,2);not null;default:0.00;comment:退款金额"`
	CollectNum  int8            `json:"collect_num" gorm:"column:collect_num;type:tinyint(1);not null;default:0;comment:收藏"`
	AddTime     int             `json:"add_time" gorm:"column:add_time;not null;default:0;comment:添加时间"`
}

func (Model) TableName() string {
	return "a_store_product_log"
}
